<head>
	<meta name="layout" content="main" />
	<title>Edit User</title>
</head>

<body>

	<div class="content">
		<h1>Edit User</h1>
		<g:if test="${flash.message}">
			<div class="message">${flash.message}</div>
		</g:if>
		<g:hasErrors bean="${person}">
		<div class="errors">
			<g:renderErrors bean="${person}" as="list" />
		</div>
		</g:hasErrors>

		<g:form action="update">

			<input type="hidden" name="id" value="${person.id}" />
			<input type="hidden" name="version" value="${person.version}" />
			<fieldset class="form">
	
				<div class="fieldcontain ${hasErrors(bean: person, field: 'username', 'errors')} ">
					<label for="username">
						Login Name:
					</label>
					<g:textField type="text" id="username" name="username" disabled="true" value="${fieldValue(bean: person, field: 'username')}"/>
				</div>
					
				<div class="fieldcontain ${hasErrors(bean: person, field: 'userRealName', 'errors')} ">
					<label for="userRealName">
						Full Name:
					</label>
					<g:textField type="text" id="userRealName" name="userRealName" value="${fieldValue(bean: person, field: 'userRealName')}"/>
				</div>
			
				<div class="fieldcontain ${hasErrors(bean: person, field: 'email', 'errors')} ">
					<label for="email">
						Email:
					</label>
					<g:textField type="text" id="email" name="email" value="${fieldValue(bean: person, field: 'email')}"/>
				</div>
			
				<div class="fieldcontain ${hasErrors(bean: person, field: 'contactPhoneNumber', 'errors')} ">
					<label for="contactPhoneNumber">
						Phone Number for Notifications:
					</label>
					<g:textField type="text" id="contactPhoneNumber" name="contactPhoneNumber" value="${fieldValue(bean: person?.profile, field: 'contactPhoneNumber')}"/>
				</div>
				
				<div class="fieldcontain ${hasErrors(bean: person, field: 'contactEmail', 'errors')} ">
					<label for="contactPhoneNumber">
						Email for Notifications:
					</label>
					<g:textField type="text" id="contactEmail" name="contactEmail" value="${fieldValue(bean: person?.profile, field: 'contactEmail')}"/>
				</div>
					
			</fieldset>

			<div class="buttons">
				<span class="button"><g:actionSubmit class="save" value="Update" /></span>
			</div>

		</g:form>

	</div>
</body>
